package c_supplier;

import java.util.function.Consumer;
import java.util.function.Supplier;

public class Demo02 {
    public static void methodAndThen(String[] str, Consumer<String> con1,Consumer<String> con2) {
        for (String info:str) {
            con1.andThen(con2).accept(info);
        }
    }
    public static void main(String[] args) {
        String[] str = {"迪丽热巴,女","汤佳琪,女"};
        methodAndThen(
                str,

                s -> {System.out.println("第一次消费:姓名:"+s.split(",")[0]);},

                s -> {System.out.println("第二次消费:性别:"+s.split(",")[1]);}
        );
    }
}